home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 November: Tool Chest / Dev.CD Nov 94.toast / Tool Chest / !Interfaces / Universal Interfaces 2.0a1 / PInterfaces / TranslationExtensions.p < prev    next >
Encoding:
Text File  |  1994-07-17  |  4.0 KB  |  151 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        TranslationExtensions.p
  3.  
  4.      Copyright:    © 1984-1994 by Apple Computer, Inc.
  5.                  All rights reserved.
  6.  
  7.      Version:    Universal Interfaces 2.0a1.  ETO #15, MPW prerelease.  Sunday, July 17, 1994. 
  8.  
  9.      Bugs?:        If you find a problem with this file, send the file and version
  10.                  information (from above) and the problem description to:
  11.  
  12.                      Internet:    apple.bugs@applelink.apple.com
  13.                      AppleLink:    APPLE.BUGS
  14.  
  15. }
  16.  
  17. {$IFC UNDEFINED UsingIncludes}
  18. {$SETC UsingIncludes := 0}
  19. {$ENDC}
  20.  
  21. {$IFC NOT UsingIncludes}
  22.  UNIT TranslationExtensions;
  23.  INTERFACE
  24. {$ENDC}
  25.  
  26. {$IFC UNDEFINED __TRANSLATIONEXTENSIONS__}
  27. {$SETC __TRANSLATIONEXTENSIONS__ := 1}
  28.  
  29. {$I+}
  30. {$SETC TranslationExtensionsIncludes := UsingIncludes}
  31. {$SETC UsingIncludes := 1}
  32.  
  33.  
  34. {$PUSH}
  35. {$ALIGN MAC68K}
  36. {$LibExport+}
  37.  
  38. CONST
  39.     kSupportsFileTranslation    = 1;
  40.     kSupportsScrapTranslation    = 2;
  41.     kTranslatorCanGenerateFilename = 4;
  42.  
  43.  
  44. {$IFC UNDEFINED __MEMORY__}
  45. {$I Memory.p}
  46. {$ENDC}
  47. {    Types.p                                                        }
  48. {        ConditionalMacros.p                                        }
  49. {    MixedMode.p                                                    }
  50.  
  51. {$IFC UNDEFINED __FILES__}
  52. {$I Files.p}
  53. {$ENDC}
  54. {    OSUtils.p                                                    }
  55.  
  56. {$IFC UNDEFINED __QUICKDRAW__}
  57. {$I Quickdraw.p}
  58. {$ENDC}
  59. {    QuickdrawText.p                                                }
  60.  
  61. {$IFC UNDEFINED __COMPONENTS__}
  62. {$I Components.p}
  63. {$ENDC}
  64.     
  65. TYPE
  66. FileType = OSType;
  67.  
  68.     ScrapType = ResType;
  69.  
  70.     TranslationAttributes = LONGINT;
  71.  
  72.  
  73. CONST
  74.     taDstDocNeedsResourceFork    = 1;
  75.     taDstIsAppTranslation        = 2;
  76.  
  77.  
  78. TYPE
  79.     FileTypeSpec = RECORD
  80.         format:                    FileType;
  81.         hint:                    LONGINT;
  82.         flags:                    TranslationAttributes;
  83.         catInfoType:            OSType;
  84.         catInfoCreator:            OSType;
  85.     END;
  86.     FileTranslationList = RECORD
  87.         modDate:                LONGINT;
  88.         groupCount:                LONGINT;
  89.     END;
  90.     FileTranslationListPtr = ^FileTranslationList;
  91.     FileTranslationListHandle = ^FileTranslationListPtr;
  92.  
  93.     ScrapTypeSpec = RECORD
  94.         format:                    ScrapType;
  95.         hint:                    LONGINT;
  96.     END;
  97.     ScrapTranslationList = RECORD
  98.         modDate:                LONGINT;
  99.         groupCount:                LONGINT;
  100.     END;
  101.     ScrapTranslationListPtr = ^ScrapTranslationList;
  102.     ScrapTranslationListHandle = ^ScrapTranslationListPtr;
  103.  
  104.     TranslationRefNum = LONGINT;
  105.  
  106.  
  107. FUNCTION SetTranslationAdvertisement(refNum: TranslationRefNum; advertisement: PicHandle): OSErr;
  108.     {$IFC NOT GENERATINGCFM}
  109.     INLINE $7002, $ABFC;
  110.     {$ENDC}
  111. FUNCTION UpdateTranslationProgress(refNum: TranslationRefNum; percentDone: INTEGER; VAR canceled: BOOLEAN): OSErr;
  112.     {$IFC NOT GENERATINGCFM}
  113.     INLINE $7001, $ABFC;
  114.     {$ENDC}
  115.  
  116. CONST
  117.     kTranslateGetFileTranslationList = 0;
  118.     kTranslateIdentifyFile        = 1;
  119.     kTranslateTranslateFile        = 2;
  120.     kTranslateGetTranslatedFilename = 3;
  121.     kTranslateGetScrapTranslationList = 10;
  122.     kTranslateIdentifyScrap        = 11;
  123.     kTranslateTranslateScrap    = 12;
  124.  
  125. TYPE
  126.     DoGetFileTranslationListProcPtr = ProcPtr;  { FUNCTION (self: ComponentInstance; translationList: FileTranslationListHandle): ComponentResult; }
  127.  
  128.     DoIdentifyFileProcPtr = ProcPtr;  { FUNCTION (self: ComponentInstance; theDocument: FSSpec; VAR docType: FileType): ComponentResult; }
  129.  
  130.     DoTranslateFileProcPtr = ProcPtr;  { FUNCTION (self: ComponentInstance; refNum: TranslationRefNum; sourceDocument: FSSpec; srcType: FileType; srcTypeHint: LONGINT; dstDoc: FSSpec; dstType: FileType; dstTypeHint: LONGINT): ComponentResult; }
  131.  
  132.     DoGetTranslatedFilenameProcPtr = ProcPtr;  { FUNCTION (self: ComponentInstance; dstType: FileType; dstTypeHint: LONGINT; VAR theDocument: FSSpec): ComponentResult; }
  133.  
  134.     DoGetScrapTranslationListProcPtr = ProcPtr;  { FUNCTION (self: ComponentInstance; list: ScrapTranslationListHandle): ComponentResult; }
  135.  
  136.     DoIdentifyScrapProcPtr = ProcPtr;  { FUNCTION (self: ComponentInstance; dataPtr: UNIV Ptr; dataLength: Size; VAR dataFormat: ScrapType): ComponentResult; }
  137.  
  138.     DoTranslateScrapProcPtr = ProcPtr;  { FUNCTION (self: ComponentInstance; refNum: TranslationRefNum; srcDataPtr: UNIV Ptr; srcDataLength: Size; srcType: ScrapType; srcTypeHint: LONGINT; dstData: Handle; dstType: ScrapType; dstTypeHint: LONGINT): ComponentResult; }
  139.  
  140.  
  141. {$ALIGN RESET}
  142. {$POP}
  143.  
  144. {$SETC UsingIncludes := TranslationExtensionsIncludes}
  145.  
  146. {$ENDC} {__TRANSLATIONEXTENSIONS__}
  147.  
  148. {$IFC NOT UsingIncludes}
  149.  END.
  150. {$ENDC}
  151.